#include <my_head.h>

int main(int argc, const char *argv[]){
    if(3 != argc){
        printf("Usage : %s src_file dest_file\n", argv[0]);
        return -1;
    }
    // 打开文件
    FILE *fp_r = fopen(argv[1], "r");
    if(NULL == fp_r)
        ERR_LOG("fopen error");
    FILE *fp_w = fopen(argv[2], "w");
    if(NULL == fp_w)
        ERR_LOG("fopen error");
    // 拷贝
    int value = 0;
    while(EOF != (value = fgetc(fp_r))){
        fputc(value, fp_w);
    }
    // 关闭文件
    fclose(fp_r);
    fclose(fp_w);
    return 0;
}